-- GENERATED SPELL FOR [Grethok the Controller] --


function spell0_12557(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(22273,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12557', 524, 1)
end

function spell1_12557(pUnit, Event) --@Dominate Mind,n/a--
pUnit:FullCastSpellOnTarget(14515,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12557', 17000, 1)
end

function spell2_12557(pUnit, Event) --@Greater Polymorph,n/a--
pUnit:FullCastSpellOnTarget(22274,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12557', 20343, 1)
end

function spell3_12557(pUnit, Event) --@Slow,n/a--
pUnit:FullCastSpellOnTarget(13747,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_12557', 10000, 1)
end

function Sorts_12557(pUnit, Event)
local choix_sorts_12557 = math.random(0, 3)
if choix_sorts_12557 == 0 then
pUnit:RegisterEvent('spell0_12557', 1, 1)
end
if choix_sorts_12557 == 1 then
pUnit:RegisterEvent('spell1_12557', 1, 1)
end
if choix_sorts_12557 == 2 then
pUnit:RegisterEvent('spell2_12557', 1, 1)
end
if choix_sorts_12557 == 3 then
pUnit:RegisterEvent('spell3_12557', 1, 1)
end
end

function mob12557_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_12557', math.random(1500, 3000), 1)
end

function mob12557_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12557_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob12557_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(12557, 1, 'mob12557_Action')
RegisterUnitEvent(12557, 2, 'mob12557_Leave')
RegisterUnitEvent(12557, 3, 'mob12557_Kill')
RegisterUnitEvent(12557, 4, 'mob12557_Die')
